let rec gcd m n =
  match n with
  | 0 -> m
  | _ -> gcd n (m % n)

let lcd m n = m * n / (gcd m n)

let sol_10 = [1..10] |> List.fold lcd 1 |> printf "%d\n"
let sol = [1..20] |> List.fold lcd 1 |> printf "%d\n"
